package com.zhq.controller;

import com.zhq.client.UserClient;
import com.zhq.entity.User;
import com.zhq.service.IBrandService;
import com.zhq.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/brand")
public class BrandController {

    @Autowired
    private IBrandService brandService;
    @Autowired
    private UserClient client;

    //查询商品列表
    @GetMapping("/list")
    public R list(){
        return R.ok(brandService.list());
    }

    //查询用户列表
    @GetMapping("/user/list")
    public R<List<User>> userList(){
        return client.list();
    }
    //获取端口
    @GetMapping("/user/getPort")
    public R getPort(){
        return client.getPort();
    }

}
